<?php
    // header('Access-Control-Allow-Origin:*');


    require('../Utils.php');

    $post = getJsonParamter();

    $username = $post['username'];
    $password = $post['password'];

    $conn = getConnection();
    $sql = "SELECT username, avatar FROM administrator WHERE username = ? AND password = ?";

    $data = query($conn, $sql, $username, $password);

    if($data['username'])   getJson(200, '登陆成功', $data);

    else getJson(500, '登陆失败,账号或密码失败', null);


?>